package no.sachmuld.methodcombination.examples.annotation.validate;

import no.sachmuld.aspectjattach.AspectJAgent;
import no.sachmuld.methodcombination.api.annotation.MethodCombinationValidator;
import no.sachmuld.methodcombination.impl.validate.MethodCombinationValidationError;

import java.util.List;

/**
 *
 */
public class Main implements Runnable {

    @Override
    public void run() {

        AspectJAgent.initializeIfNeeded();

        new Runnable() {

            @Override
            public void run() {

                List<MethodCombinationValidationError> errors = new MethodCombinationValidator(Foo.class).validate();
                for (MethodCombinationValidationError error : errors) {
                    System.out.println(error);
                }

                Foo foo = new Foo();
                System.out.println(foo.bar());

            }

        }.run();

    }

    public static void main(String... args) throws Exception {

        new Main().run();

    }

}